package com.brush.pig.domain.req.pig;

import cn.hutool.core.util.StrUtil;
import com.brush.common.core.domain.page.PageAbstructReq;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.math.BigDecimal;
import java.util.Date;

@Getter
@Setter
@ToString(callSuper = true)

@ApiModel(value = "PigReq", description = "猪请求对象")
public class PigQueryReq extends PageAbstructReq {
    /**
     * 主键
     */
    @ApiModelProperty(value = "主键")
    private Long id;

    /**
     * 批次
     */
    @ApiModelProperty(value = "批次")
    private String batch;

    /**
     * 编号
     */
    @ApiModelProperty(value = "编号")
    private String code;

    /**
     * 猪只类型（数据字典）
     */
    @ApiModelProperty(value = "猪只类型（数据字典）")
    private String type;

    /**
     * 重量
     */
    @ApiModelProperty(value = "重量")
    private BigDecimal weight;

    /**
     * 耳标编号
     */
    @ApiModelProperty(value = "耳标编号")
    private String earCode;

    /**
     * 胎次（母猪）
     */
    @ApiModelProperty(value = "胎次（母猪）")
    private Integer parity;

    /**
     * 状态（数据字典）
     */
    @ApiModelProperty(value = "状态（数据字典）")
    private String status;

    /**
     * 栏位ID
     */
    @ApiModelProperty(value = "栏位ID")
    private Long deptId;



    @ApiOperation(value = "排序")
    @Override
    public String getOrderBy() {
        if (StrUtil.isNotBlank(super.getOrderByColumn())) {
            return super.getOrderByColumn() + " " + super.getIsAsc();
        }
        return null;
    }
}
